<%-- by Paolo Ciccarese --%>
<%-- 
Parameters list
 1) item | instance of GroupCreateCommand
Stylesheet
 1) fieldError | background and font color in erroneous text fields
--%>
<div class="sectioncontainer">
<div class="dialog" style="width: 560px">
    <fieldset>
    	<legend>User Groups</legend>
		<div class="list">
			<g:set var="g" value=${group}/>
			<table>
				<thead>
					<tr>
						<g:sortableColumn property="name" title="${message(code: 'agentPerson.id.label', default: 'Group Name')}" style="width: 200px" />
						<g:sortableColumn property="role" title="${message(code: 'agentPerson.id.label', default: 'User Role')}" style="width: 110px" />
						<g:sortableColumn property="role" title="${message(code: 'agentPerson.id.label', default: 'Status')}" style="width: 200px" />
						<g:sortableColumn property="since" title="${message(code: 'agentPerson.id.label', default: 'Member Since')}" style="width: 200px" />
					</tr>
				</thead>
				<tbody>
					<g:each in="${userGroups}" status="i" var="userGroup">
						<tr>
							<td>${userGroup.group.name}</td>
							<td>
								<g:select name="userGroup.user.id"
          							from="${groupRoles}"
          							value="${userGroup.role.label}"
          							optionKey="label"
          							/>
							</td>
							<td>X</td>
							<td>${userGroup.dateCreated}</td>
						</tr>
					</g:each>
				</tbody>
			</table>
			<div class="paginateButtons">
		   		<g:paginate total="1" />
			</div>
		</div>
		<div class="buttons">
			<span class="button">
				<g:actionSubmit class="save" action="updateUser" value="${message(code: 'default.button.edit.account.label', default: 'Update user roles')}" />
				<g:actionSubmit class="save" action="updateUser" value="${message(code: 'default.button.edit.account.label', default: 'Delete selected')}" />
			</span>
		</div>
</fieldset>
</div>
</div>
